<?

$this->breadcrumbs[] = UserModule::t('app', 'Профиль');
$this->pageTitle = UserModule::t('app', 'Профиль');

$MODCONF = $this->getModule()->auth;

?>

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'profile-main-form',
    'enableAjaxValidation'=>false,
    'htmlOptions' => array(
        'enctype'=>'multipart/form-data'
    ),
)); ?>

<div class="form">
    
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'email'); ?>
        <?=$form->textField($FORMPROFILE,'email'); ?>
        <?=$form->error($FORMPROFILE,'email'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'nick'); ?>
        <?=$form->textField($FORMPROFILE,'nick'); ?>
        <?=$form->error($FORMPROFILE,'nick'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'name'); ?>
        <?=$form->textField($FORMPROFILE,'name'); ?>
        <?=$form->error($FORMPROFILE,'name'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'lname'); ?>
        <?=$form->textField($FORMPROFILE,'lname'); ?>
        <?=$form->error($FORMPROFILE,'lname'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'avatar'); ?>
        <?=$form->fileField($FORMPROFILE,'avatar'); ?>
        <?
        if(!empty(Yii::app()->user->GetModel()->avatar)){
            echo CHtml::image(Yii::app()->user->GetModel()->avatar);
        }
        ?>
        <?=$form->error($FORMPROFILE,'avatar'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'password_old'); ?>
        <?=$form->passwordField($FORMPROFILE,'password_old'); ?>
        <small>Нужно ввести для сохранения изменений профиля</small>
        <?=$form->error($FORMPROFILE,'password_old'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'password_new'); ?>
        <?=$form->passwordField($FORMPROFILE,'password_new'); ?>
        <small>Если хотите сменить пароль, заполните старый и введите новый</small>
        <?=$form->error($FORMPROFILE,'password_new'); ?>
    </div>
    <div class="row">
        <?=$form->labelEx($FORMPROFILE,'password_app'); ?>
        <?=$form->passwordField($FORMPROFILE,'password_app'); ?>
        <?=$form->error($FORMPROFILE,'password_app'); ?>
    </div>
    <div class="row">
        <?=CHtml::submitButton(UserModule::t('app', 'Сохранить изменения'))?>
    </div>
    
</div>

<?php $this->endWidget(); ?>
